home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / createNormalSurfaceManip.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  18.3 KB  |  510 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. // Copyright (C) 1997-1999 Alias|Wavefront,
  18. // a division of Silicon Graphics Limited.
  19. //
  20. // The information in this file is provided for the exclusive use of the
  21. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  22. // and incorporate this code into other products for purposes authorized
  23. // by the Alias|Wavefront license agreement, without fee.
  24. //
  25. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  26. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  27. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  28. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  29. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  30. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  31. // PERFORMANCE OF THIS SOFTWARE.
  32. //
  33. includeEffectsGlobals();
  34.  
  35. proc markAllNewNodes( string $old[], string $new[], string $markingAttr )
  36. {
  37.     int $i;
  38.     for( $i = 0; $i < size( $new ); $i ++ )
  39.     {
  40.         int $index = findInStringArray( $new[$i], $old );
  41.         if( $index < 0 )
  42.         {
  43.             connectAttr -nextAvailable ($new[$i]+".message") $markingAttr;
  44.         }
  45.     }
  46. }
  47.  
  48. proc lockAndHideTransformAttributes( string $object )
  49. {
  50.     string $ls[] = `ls -type transform $object`;
  51.     if( size($ls) == 0 )
  52.         return;
  53.  
  54.     setAttr -lock 1 ($object+".translateX");
  55.     setAttr -lock 1 ($object+".translateY");
  56.     setAttr -lock 1 ($object+".translateZ");
  57.     setAttr -keyable 0 ($object+".translateX");
  58.     setAttr -keyable 0 ($object+".translateY");
  59.     setAttr -keyable 0 ($object+".translateZ");
  60.  
  61.     setAttr -lock 1 ($object+".rotateX");
  62.     setAttr -lock 1 ($object+".rotateY");
  63.     setAttr -lock 1 ($object+".rotateZ");
  64.     setAttr -keyable 0 ($object+".rotateX");
  65.     setAttr -keyable 0 ($object+".rotateY");
  66.     setAttr -keyable 0 ($object+".rotateZ");
  67.  
  68.     setAttr -lock 1 ($object+".scaleX");
  69.     setAttr -lock 1 ($object+".scaleY");
  70.     setAttr -lock 1 ($object+".scaleZ");
  71.     setAttr -keyable 0 ($object+".scaleX");
  72.     setAttr -keyable 0 ($object+".scaleY");
  73.     setAttr -keyable 0 ($object+".scaleZ");
  74.  
  75.     setAttr -lock 1 ($object+".shearXY");
  76.     setAttr -lock 1 ($object+".shearXZ");
  77.     setAttr -lock 1 ($object+".shearYZ");
  78.     setAttr -keyable 0 ($object+".shearXY");
  79.     setAttr -keyable 0 ($object+".shearXZ");
  80.     setAttr -keyable 0 ($object+".shearYZ");
  81.  
  82.     setAttr -keyable 0 ($object+".visibility");
  83. }
  84.  
  85. global proc string createNormalSurfaceManip( string $baseSurface, string $axis, float $location, int $resolutionU, int $resolutionV )
  86. {
  87.     if( ($axis != "u" ) &&
  88.         ($axis != "v" ) &&
  89.         ($axis != "x" ) )
  90.     {
  91.         error("Invalid manipulator type, \""+$axis+"\".  Must by \"u\", \"v\", or \"x\".");
  92.         return "";
  93.     }
  94.  
  95.     string $surfaceShape = getShapeFromObject( $baseSurface, 0, 0 );
  96.     if( $surfaceShape == "" )
  97.     {
  98.         error("Given object, \""+$baseSurface+"\", is not a NURBS surface.");
  99.         return "";
  100.     }
  101.  
  102.     if( `nodeType $surfaceShape` != "nurbsSurface" )
  103.     {
  104.         error("Given object, \""+$baseSurface+"\", is not a NURBS surface.");
  105.         return "";
  106.     }
  107.  
  108.     string $oldNodeList[] = `ls`;
  109.  
  110.     float $surfaceMinU = `getAttr ($surfaceShape+".minValueU")`;
  111.     float $surfaceMaxU = `getAttr ($surfaceShape+".maxValueU")`;
  112.     float $rangeU = $surfaceMaxU - $surfaceMinU;
  113.  
  114.     float $surfaceMinV = `getAttr ($surfaceShape+".minValueV")`;
  115.     float $surfaceMaxV = `getAttr ($surfaceShape+".maxValueV")`;
  116.     float $rangeV = $surfaceMaxV - $surfaceMinV;
  117.  
  118.  
  119.     float $minU = 0;
  120.     float $maxU = 1;
  121.     float $minV = 0;
  122.     float $maxV = 1;
  123.  
  124.     string $manipName = "";
  125.     if( $axis == "u" )
  126.     {
  127.         $minV = $maxV = $surfaceMinV + $rangeV * .5;
  128.         $manipName = "NormalSurfaceUManip#";
  129.     }
  130.     else if( $axis == "v" )
  131.     {
  132.         $minU = $maxU = $surfaceMinU + $rangeU * .5;
  133.         $manipName = "NormalSurfaceVManip#";
  134.     }
  135.  
  136.     group -empty -name $manipName;
  137.     string $manipGroup = getSelectedObject( 0 );
  138.     // addAttr -at message -ln "_normalSurfaceManip_" $manipGroup;
  139.     addMarkingAttribute($manipGroup,"_normalSurfaceManip_",0);
  140.  
  141.     //
  142.     // The curve-on-surface for the manipulator is cubic to keep it smooth.
  143.     //
  144.     curveOnSurface -d 3 -uv $minU $minV -uv $minU $minV -uv $maxU $maxV -uv $maxU $maxV -k 0 -k 0 -k 0 -k 1 -k 1 -k 1 $surfaceShape;
  145.     string $curve = getSelectedObject( 0 );
  146.     lockAndHideTransformAttributes( $curve );
  147.     // addAttr -at message -ln "manipBaseCurve" $manipGroup;
  148.     markObjectWithAttribute($curve,$manipGroup,"manipBaseCurve");
  149.     // connectAttr ($curve+".message") ($manipGroup+".manipBaseCurve");
  150.  
  151.     createNode pointOnSurfaceInfo;
  152.     string $posi = getSelectedObject( 0 );
  153.     connectAttr ($surfaceShape+".worldSpace[0]") ($posi+".inputSurface");
  154.     setAttr -lock 1 ($curve+".translate");
  155.     setAttr -lock 1 ($curve+".rotate");
  156.     setAttr -lock 1 ($curve+".scale");
  157.  
  158.     string $locationString = "";
  159.     string $minValueString = "";
  160.     string $maxValueString = "";
  161.  
  162.     string $expressionString = "";
  163.  
  164.     if( $axis != "x" )
  165.     {
  166.         lockAndHideTransformAttributes( $manipGroup );
  167.         {
  168.             createNode plusMinusAverage;
  169.             string $pma = getSelectedObject( 0 );
  170.             connectAttr ($curve+".cp[0]") ($pma+".input3D[0]");
  171.             connectAttr ($curve+".cp[1]") ($pma+".input3D[1]");
  172.             connectAttr ($curve+".cp[2]") ($pma+".input3D[2]");
  173.             connectAttr ($curve+".cp[3]") ($pma+".input3D[3]");
  174.             setAttr ($pma+".operation") 3;
  175.     
  176.             connectAttr ($pma+".output3Dx") ($posi+".parameterU");
  177.             connectAttr ($pma+".output3Dy") ($posi+".parameterV");
  178.         }
  179.  
  180.         if( $axis == "u" )
  181.         {
  182.             setAttr ($curve+".cp[0].yValue") $surfaceMinV;
  183.             setAttr ($curve+".cp[1].yValue") ($surfaceMinV + ($surfaceMaxV - $surfaceMinV)/3.0);
  184.             setAttr ($curve+".cp[2].yValue") ($surfaceMinV + 2.0 * ($surfaceMaxV - $surfaceMinV)/3.0);
  185.             setAttr ($curve+".cp[3].yValue") $surfaceMaxV;
  186.  
  187.             $locationString = "uLocation";
  188.             $minValueString = "minV";
  189.             $maxValueString = "maxV";
  190.         }
  191.         else
  192.         {
  193.             setAttr ($curve+".cp[0].xValue") $surfaceMinU;
  194.             setAttr ($curve+".cp[1].yValue") ($surfaceMinU + ($surfaceMaxU - $surfaceMinU)/3.0);
  195.             setAttr ($curve+".cp[2].yValue") ($surfaceMinU + 2.0 * ($surfaceMaxU - $surfaceMinU)/3.0);
  196.             setAttr ($curve+".cp[3].xValue") $surfaceMaxU;
  197.  
  198.             $locationString = "vLocation";
  199.             $minValueString = "minU";
  200.             $maxValueString = "maxU";
  201.         }
  202.  
  203.         addAttr -ln $locationString -min $surfaceMinU -max $surfaceMaxU
  204.             -dv $location $manipGroup;
  205.         setAttr -keyable 1 ($manipGroup+"."+$locationString);
  206.         if( $axis == "u" )
  207.         {
  208.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[0].xValue");
  209.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[1].xValue");
  210.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[2].xValue");
  211.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[3].xValue");
  212.         }
  213.         else
  214.         {
  215.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[0].yValue");
  216.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[1].yValue");
  217.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[2].yValue");
  218.             connectAttr ($manipGroup+"."+$locationString) ($curve+".cp[3].yValue");
  219.         }
  220.  
  221.         addAttr -ln "minDistance" -dv 1 $manipGroup;
  222.         setAttr -keyable 1 ($manipGroup+".minDistance");
  223.         addAttr -ln "maxDistance" -dv 2 $manipGroup;
  224.         setAttr -keyable 1 ($manipGroup+".maxDistance");
  225.  
  226.         addAttr -ln $minValueString -min $surfaceMinV -max $surfaceMaxV
  227.             -dv $surfaceMinV  $manipGroup;
  228.         setAttr -keyable 1 ($manipGroup+"."+$minValueString);
  229.  
  230.         addAttr -ln $maxValueString -min $surfaceMinV -max $surfaceMaxV
  231.             -dv $surfaceMaxV  $manipGroup;
  232.         setAttr -keyable 1 ($manipGroup+"."+$maxValueString);
  233.  
  234.         //
  235.         // Create the expression to keep the curve-on-surface's CV's evenly
  236.         // spaced across the "sampled" section of the main surface.
  237.         //
  238.         if( $axis == "u" )
  239.         {
  240.             string $minStr = $manipGroup+"."+$minValueString;
  241.             string $maxStr = $manipGroup+"."+$maxValueString;
  242.             $expressionString += ($curve+".cp[0].yValue = "+$minStr+";\n");
  243.             $expressionString += ($curve+".cp[1].yValue = "+$minStr+" + ("+$maxStr+"-"+$minStr+")/3.0;\n");
  244.             $expressionString += ($curve+".cp[2].yValue = "+$minStr+" + 2.0 * ("+$maxStr+"-"+$minStr+")/3.0;\n");
  245.             $expressionString += ($curve+".cp[3].yValue = "+$maxStr+";\n");
  246.         }
  247.         else
  248.         {
  249.             string $minStr = $manipGroup+"."+$minValueString;
  250.             string $maxStr = $manipGroup+"."+$maxValueString;
  251.             $expressionString += ($curve+".cp[0].xValue = "+$minStr+";\n");
  252.             $expressionString += ($curve+".cp[1].xValue = "+$minStr+" + ("+$maxStr+"-"+$minStr+")/3.0;\n");
  253.             $expressionString += ($curve+".cp[2].xValue = "+$minStr+" + 2.0 * ("+$maxStr+"-"+$minStr+")/3.0;\n");
  254.             $expressionString += ($curve+".cp[3].xValue = "+$maxStr+";\n");
  255.         }
  256.  
  257.         setAttr ($curve+".template") 1;
  258.     }
  259.     else
  260.     {
  261.     }
  262.  
  263.     //
  264.     // Create offset curves
  265.     //
  266.     offsetCurve -ch on -rn false -cb 0 -st true -cl true -d 1 $curve;
  267.     string $minOffsetCurve = getSelectedObject( 0 );
  268.     string $minHistory[] = `listHistory -leaf true -levels 1 $minOffsetCurve`;
  269.     string $minHistoryOffsets[] = `ls -type offsetCurve $minHistory`;
  270.     string $minOffset = $minHistoryOffsets[0];
  271.     lockAndHideTransformAttributes( $minOffsetCurve );
  272.  
  273.     // addAttr -at message -ln "manipMinOffset" $manipGroup;
  274.     // connectAttr ($minOffsetCurve+".message") ($manipGroup+".manipMinOffset");
  275.     markObjectWithAttribute($minOffsetCurve,$manipGroup,"manipMinOffset");
  276.  
  277.     offsetCurve -ch on -rn false -cb 0 -st true -cl true -d 2 $curve;
  278.     string $maxOffsetCurve = getSelectedObject( 0 );
  279.     string $maxHistory[] = `listHistory -leaf true -levels 1 $maxOffsetCurve`;
  280.     string $maxHistoryOffsets[] = `ls -type offsetCurve $maxHistory`;
  281.     string $maxOffset = $maxHistoryOffsets[0];
  282.     lockAndHideTransformAttributes( $maxOffsetCurve );
  283.  
  284.     // addAttr -at message -ln "manipMaxOffset" $manipGroup;
  285.     // connectAttr ($maxOffsetCurve+".message") ($manipGroup+".manipMaxOffset");
  286.     markObjectWithAttribute($maxOffsetCurve,$manipGroup,"manipMaxOffset");
  287.  
  288.     if( $axis == "u" )
  289.     {
  290.         connectAttr ($posi+".tangentU") ($minOffset+".normal");
  291.         connectAttr ($posi+".tangentU") ($maxOffset+".normal");
  292.  
  293.         connectAttr ($manipGroup+".minDistance") ($minOffset+".distance");
  294.         connectAttr ($manipGroup+".maxDistance") ($maxOffset+".distance");
  295.         loft -ch 1 -u 1 -c 0 -ar 0 -d 3 -rn 0 -po 0 $maxOffsetCurve $minOffsetCurve;
  296.         displaySmoothness -divisionsU 0 -divisionsV 3 -pointsWire 4 -pointsShaded 4;
  297.     }
  298.     else if( $axis == "v" )
  299.     {
  300.         connectAttr ($posi+".tangentV") ($minOffset+".normal");
  301.         connectAttr ($posi+".tangentV") ($maxOffset+".normal");
  302.  
  303.         $expressionString += ($minOffset+".distance = -"+$manipGroup+".minDistance;\n");
  304.         $expressionString += ($maxOffset+".distance = -"+$manipGroup+".maxDistance;\n");
  305.         loft -ch 1 -u 1 -c 0 -ar 0 -d 3 -rn 0 -po 0 $minOffsetCurve $maxOffsetCurve;
  306.         displaySmoothness -divisionsU 0 -divisionsV 3 -pointsWire 4 -pointsShaded 4;
  307.     }
  308.     else
  309.     {
  310.         //
  311.         // I have no idea how to set the normal of the offsetCurve node
  312.         // for this type of manipulator.
  313.         //
  314.     }
  315.  
  316.     expression -s $expressionString -alwaysEvaluate false -name "NormalSurfaceManipExpr#";
  317.  
  318.     string $loft = getSelectedObject( 0 );
  319.     $loft = getSelectedObject( 0 );
  320.     string $loftShape = getShapeFromObject( $loft, 0, 0 );
  321.     lockAndHideTransformAttributes( $loft );
  322.     // addAttr -at message -ln "manipLoft" $manipGroup;
  323.     // connectAttr ($loft+".message") ($manipGroup+".manipLoft");
  324.     markObjectWithAttribute($loft,$manipGroup,"manipLoft");
  325.  
  326.     string $ramp = createRampFromSurface( $loft, $resolutionU, $resolutionV, 1 );
  327.     //
  328.     // The RampResolutionPlane is the polygonal plane generated for the surface
  329.     // to illustrate exactly which points on the surface are being sampled to
  330.     // generate the ramp.
  331.     //
  332.     string $rampResPlane = getSelectedObject( 1 );
  333.     markObjectWithAttribute($rampResPlane,$manipGroup,"manipResolutionPlane");
  334.     // addAttr -at message -ln "manipRamp" $manipGroup;
  335.     // connectAttr ($ramp+".message") ($manipGroup+".manipRamp");
  336.     markObjectWithAttribute($ramp,$manipGroup,"manipRamp");
  337.     // shadingNode -asShader lambert;
  338.     // string $shader = getSelectedObject( 0 );
  339.     // string $shadingGroup = `sets -renderable true -noSurfaceShader true -empty -name ($shader+"SG")`;
  340.     // connectAttr ($shader+".outColor") ($shadingGroup+".surfaceShader");
  341.     // defaultNavigation -connectToExisting -force true -source $ramp -destination $shadingGroup;
  342.     // defaultNavigation -source $shadingGroup -destination ($loftShape+".instObjGroups[0]") -connectToExisting;
  343.  
  344.     // Add edge curve for strength ramp display.
  345.     curveOnSurface -d 1 -uv 0 0 -uv 1 0 -k 0 -k 1 $loft;
  346.     string $strengthCurve = getSelectedObject( 0 );
  347.     lockAndHideTransformAttributes( $strengthCurve );
  348.     // addAttr -at message -ln "manipEdgeCurve" $manipGroup;
  349.     // connectAttr ($strengthCurve+".message") ($manipGroup+".manipEdgeCurve");
  350.     markObjectWithAttribute($strengthCurve,$manipGroup,"manipEdgeCurve");
  351.  
  352.     connectAttr ($manipGroup+"."+$minValueString) ($strengthCurve+".cp[0].yValue");
  353.     connectAttr ($manipGroup+"."+$minValueString) ($strengthCurve+".cp[1].yValue");
  354.  
  355.     parent $minOffsetCurve $manipGroup;
  356.     parent $maxOffsetCurve $manipGroup;
  357.     parent $rampResPlane $manipGroup;
  358.     parent $loft $manipGroup;
  359.  
  360.     setAttr ($minOffsetCurve+".visibility") 0;
  361.     setAttr ($maxOffsetCurve+".visibility") 0;
  362.     setAttr ($minOffsetCurve+".template") 1;
  363.     setAttr ($maxOffsetCurve+".template") 1;
  364.  
  365.     // Add edge curve for minDistance
  366.     curveOnSurface -d 3 -uv 0 0 -uv 0 0.33333 -uv 0 0.66667 -uv 0 1 -k 0 -k 0 -k 0 -k 1 -k 1 -k 1 $loft;
  367.     string $minCurve = getSelectedObject( 0 );
  368.     lockAndHideTransformAttributes( $minCurve );
  369.  
  370.     connectAttr ($manipGroup+"."+$minValueString) ($minCurve+".cp[0].yValue");
  371.     connectAttr ($manipGroup+"."+$maxValueString) ($minCurve+".cp[1].yValue");
  372.     connectAttr ($manipGroup+"."+$maxValueString) ($minCurve+".cp[2].yValue");
  373.     connectAttr ($manipGroup+"."+$maxValueString) ($minCurve+".cp[3].yValue");
  374.  
  375.     // Add edge curve for maxDistance
  376.     curveOnSurface -d 3 -uv 1 0 -uv 1 0.33333 -uv 1 0.66667 -uv 1 1 -k 0 -k 0 -k 0 -k 1 -k 1 -k 1 $loft;
  377.     string $maxCurve = getSelectedObject( 0 );
  378.     lockAndHideTransformAttributes( $maxCurve );
  379.  
  380.     connectAttr ($manipGroup+"."+$minValueString) ($maxCurve+".cp[0].yValue");
  381.     connectAttr ($manipGroup+"."+$maxValueString) ($maxCurve+".cp[1].yValue");
  382.     connectAttr ($manipGroup+"."+$maxValueString) ($maxCurve+".cp[2].yValue");
  383.     connectAttr ($manipGroup+"."+$maxValueString) ($maxCurve+".cp[3].yValue");
  384.  
  385.     string $newNodeList[] = `ls`;
  386.     // addAttr -at message -ln "createdNodes" -multi -indexMatters false $manipGroup;
  387.     //
  388.     // Commenting this out because it takes longer for each new manip.
  389.     //
  390.     // addMarkingAttribute($manipGroup,"createdNodes",1);
  391.     // markAllNewNodes( $oldNodeList, $newNodeList, ($manipGroup+".createdNodes") );
  392.     //
  393.  
  394.     select $manipGroup;
  395.     return $manipGroup;
  396. }
  397.  
  398. global proc int isNormalSurfaceManip( string $object )
  399. {
  400.     if( `attributeQuery -exists -node $object "_normalSurfaceManip_"` == 1 )
  401.         return 1;
  402.     else
  403.         return 0;
  404. }
  405.  
  406. global proc int deleteNormalSurfaceManip( string $manip )
  407. {
  408.     if( isNormalSurfaceManip( $manip ) == 0 )
  409.         return 0;
  410.  
  411.     // string $createdNodes[] = `listConnections -source true -destination false ($manip+".createdNodes")`;
  412.     string $createdNodes[] = getMarkedObjects( $manip, "createdNodes" );
  413.     if( size( $createdNodes ) > 0 )
  414.     {
  415.         delete $createdNodes;
  416.     }
  417.  
  418.     return 1;
  419. }
  420.  
  421. global proc string getLoftFromNormalSurfaceManip( string $manip )
  422. {
  423.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  424.     {
  425.         // string $loft[] = `listConnections -source true -destination false ($manip+".manipLoft")`;
  426.         string $loft[] = getMarkedObjects( $manip, "manipLoft" );
  427.         if( size( $loft ) == 0 )
  428.             return "";
  429.         else
  430.             return $loft[0];
  431.     }
  432.  
  433.     return "";
  434. }
  435.  
  436. global proc string getResolutionPlaneFromNormalSurfaceManip( string $manip )
  437. {
  438.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  439.     {
  440.         // string $resPlane[] = `listConnections -source true -destination false ($manip+".manipResolutionPlane")`;
  441.         string $resPlane[] = getMarkedObjects( $manip, "manipResolutionPlane" );
  442.         if( size( $resPlane ) == 0 )
  443.             return "";
  444.         else
  445.             return $resPlane[0];
  446.     }
  447.  
  448.     return "";
  449. }
  450.  
  451. global proc string getRampFromNormalSurfaceManip( string $manip )
  452. {
  453.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  454.     {
  455.         // string $ramp[] = `listConnections -source true -destination false ($manip+".manipRamp")`;
  456.         string $ramp[] = getMarkedObjects( $manip, "manipRamp" );
  457.         if( size( $ramp ) == 0 )
  458.             return "";
  459.         else
  460.             return $ramp[0];
  461.     }
  462.  
  463.     return "";
  464. }
  465.  
  466. global proc string getMinCurveFromNormalSurfaceManip( string $manip )
  467. {
  468.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  469.     {
  470.         // string $curve[] = `listConnections -source true -destination false ($manip+".manipMinOffset")`;
  471.         string $curve[] = getMarkedObjects( $manip, "manipMinOffset" );
  472.         if( size( $curve ) == 0 )
  473.             return "";
  474.         else
  475.             return $curve[0];
  476.     }
  477.  
  478.     return "";
  479. }
  480.  
  481. global proc string getMaxCurveFromNormalSurfaceManip( string $manip )
  482. {
  483.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  484.     {
  485.         // string $curve[] = `listConnections -source true -destination false ($manip+".manipMaxOffset")`;
  486.         string $curve[] = getMarkedObjects( $manip, "manipMaxOffset" );
  487.         if( size( $curve ) == 0 )
  488.             return "";
  489.         else
  490.             return $curve[0];
  491.     }
  492.  
  493.     return "";
  494. }
  495.  
  496. global proc string getEdgeCurveFromNormalSurfaceManip( string $manip )
  497. {
  498.     if( `attributeQuery -exists -node $manip "_normalSurfaceManip_"` == 1 )
  499.     {
  500.         // string $curve[] = `listConnections -source true -destination false ($manip+".manipEdgeCurve")`;
  501.         string $curve[] = getMarkedObjects( $manip, "manipEdgeCurve" );
  502.         if( size( $curve ) == 0 )
  503.             return "";
  504.         else
  505.             return $curve[0];
  506.     }
  507.  
  508.     return "";
  509. }
  510.